

<template>
  <div class="app">
    <!-- 2024.4.9: 加载header组件-->
    <Header/>
    <div class="navigation">
      <RouterLink to="/home" active-class="active">首页</RouterLink>
      <RouterLink to="/news" active-class="active">新闻</RouterLink>
      <RouterLink to="/about" active-class="active">关于</RouterLink>
    </div>
    <div class="main-content">
      <!--第4步 显示路由器-->
     <RouterView></RouterView>
    </div>
  </div>
</template>
<script lang="ts" setup name="App">
 //第3步 显示路由器
import { RouterView, RouterLink } from 'vue-router';
import Header from './components/Header.vue';
</script>

<style>

.navigation {
  display: flex;
  justify-content: space-around;
  margin: 0 100px;
}
.navigation a { 
  display: block;
  text-align: center;
  width: 90px;
  height: 40px;
  line-height: 40px;
  background-color: gray;
  text-decoration: none;
  color: white;
  font-size: 18px;
  letter-spacing: 5px;
}
/** 处理点中后的样式 */
.navigation a.active {
 background-color: #64967e;
 color: #ffc268;
 font-weight: 900;
 text-shadow: 0 0 1px black;
 font-family: 微软雅黑;

}
.main-content {
  margin: 0 auto;
  margin-top: 30px;
  border-radius: 10px;
  width: 90%;
  height: 400px;
  border: 1px solid;
}
</style>
